
package com.mal.wumpus;

import java.awt.Image;
import javax.swing.ImageIcon;

/**
 *
 * @author John-Paul Menard
 */
public class Wumpus extends javax.swing.JFrame {

    /**
     * Creates new form Wumpus
     */
    public Wumpus() {
        // Set the Wumpus JFrame icon.
            java.net.URL imgURL = getClass().getResource("images/wumpus.gif");
            jFIcon = new ImageIcon(imgURL).getImage();
        
        // System tray icon and tooltip if possible.
        
        // Set up components with code generated by the NetBeans GUI designer.
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        tabPn = new javax.swing.JTabbedPane();
        agentPnl = new javax.swing.JPanel();
        worldPnl = new javax.swing.JPanel();
        logScPn = new javax.swing.JScrollPane();
        choicePnl = new javax.swing.JPanel();
        agentLbl = new javax.swing.JLabel();
        worldLbl = new javax.swing.JLabel();
        scoreLbl = new javax.swing.JLabel();
        agentCBox = new javax.swing.JComboBox();
        worldCBox = new javax.swing.JComboBox();
        scoreTF = new javax.swing.JTextField();
        btnPnl = new javax.swing.JPanel();
        stepBtn = new javax.swing.JButton();
        runBtn = new javax.swing.JButton();
        resetBtn = new javax.swing.JButton();
        menuBar = new javax.swing.JMenuBar();
        fileMenu = new javax.swing.JMenu();
        createWorldItem = new javax.swing.JMenuItem();
        loadItem = new javax.swing.JMenuItem();
        helpMenu = new javax.swing.JMenu();
        aboutItem = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Wumpus");
        setIconImage(jFIcon);
        setLocationByPlatform(true);
        setName("");

        tabPn.setName("");

        agentPnl.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout agentPnlLayout = new javax.swing.GroupLayout(agentPnl);
        agentPnl.setLayout(agentPnlLayout);
        agentPnlLayout.setHorizontalGroup(
            agentPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 330, Short.MAX_VALUE)
        );
        agentPnlLayout.setVerticalGroup(
            agentPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 318, Short.MAX_VALUE)
        );

        tabPn.addTab("Agent View", agentPnl);

        worldPnl.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout worldPnlLayout = new javax.swing.GroupLayout(worldPnl);
        worldPnl.setLayout(worldPnlLayout);
        worldPnlLayout.setHorizontalGroup(
            worldPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 330, Short.MAX_VALUE)
        );
        worldPnlLayout.setVerticalGroup(
            worldPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 318, Short.MAX_VALUE)
        );

        tabPn.addTab("World", worldPnl);
        tabPn.addTab("Log", logScPn);

        agentLbl.setText("Agent:");

        worldLbl.setText("World:");

        scoreLbl.setText("Score:");

        agentCBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Human", "Smart", "99", " " }));

        worldCBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "AIMA", "Random", " ", " " }));

        scoreTF.setColumns(5);
        scoreTF.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        scoreTF.setText("0");
        scoreTF.setAutoscrolls(false);
        scoreTF.setFocusable(false);
        scoreTF.setVerifyInputWhenFocusTarget(false);

        javax.swing.GroupLayout choicePnlLayout = new javax.swing.GroupLayout(choicePnl);
        choicePnl.setLayout(choicePnlLayout);
        choicePnlLayout.setHorizontalGroup(
            choicePnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(choicePnlLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(choicePnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(choicePnlLayout.createSequentialGroup()
                        .addComponent(worldLbl)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(worldCBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(choicePnlLayout.createSequentialGroup()
                        .addComponent(scoreLbl)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(scoreTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(choicePnlLayout.createSequentialGroup()
                        .addComponent(agentLbl)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(agentCBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(20, Short.MAX_VALUE))
        );
        choicePnlLayout.setVerticalGroup(
            choicePnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(choicePnlLayout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(choicePnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(agentLbl)
                    .addComponent(agentCBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(49, 49, 49)
                .addGroup(choicePnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(worldLbl)
                    .addComponent(worldCBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(37, 37, 37)
                .addGroup(choicePnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(scoreLbl)
                    .addComponent(scoreTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(45, Short.MAX_VALUE))
        );

        stepBtn.setText("Step");

        runBtn.setText("Run");

        resetBtn.setText("Reset");

        javax.swing.GroupLayout btnPnlLayout = new javax.swing.GroupLayout(btnPnl);
        btnPnl.setLayout(btnPnlLayout);
        btnPnlLayout.setHorizontalGroup(
            btnPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(btnPnlLayout.createSequentialGroup()
                .addGap(30, 30, 30)
                .addComponent(stepBtn)
                .addGap(18, 18, 18)
                .addComponent(runBtn)
                .addGap(18, 18, 18)
                .addComponent(resetBtn)
                .addContainerGap(36, Short.MAX_VALUE))
        );
        btnPnlLayout.setVerticalGroup(
            btnPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(btnPnlLayout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(btnPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(stepBtn)
                    .addComponent(runBtn)
                    .addComponent(resetBtn))
                .addContainerGap(27, Short.MAX_VALUE))
        );

        fileMenu.setText("File");

        createWorldItem.setText("Create world ...");
        fileMenu.add(createWorldItem);

        loadItem.setText("Load world ...");
        fileMenu.add(loadItem);

        menuBar.add(fileMenu);

        helpMenu.setText("Help");

        aboutItem.setText("About");
        helpMenu.add(aboutItem);

        menuBar.add(helpMenu);

        setJMenuBar(menuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(choicePnl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(tabPn, javax.swing.GroupLayout.PREFERRED_SIZE, 337, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(btnPnl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(30, 30, 30)))
                .addContainerGap(77, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(43, 43, 43)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(tabPn, javax.swing.GroupLayout.PREFERRED_SIZE, 345, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(choicePnl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(btnPnl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the System look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code ">
        try {
            javax.swing.UIManager.setLookAndFeel(
                javax.swing.UIManager.getSystemLookAndFeelClassName());
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Wumpus.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Wumpus.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Wumpus.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Wumpus.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        
        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Wumpus().setVisible(true);
            }
        });
    }
    
    private static Image jFIcon;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem aboutItem;
    private javax.swing.JComboBox agentCBox;
    private javax.swing.JLabel agentLbl;
    private javax.swing.JPanel agentPnl;
    private javax.swing.JPanel btnPnl;
    private javax.swing.JPanel choicePnl;
    private javax.swing.JMenuItem createWorldItem;
    private javax.swing.JMenu fileMenu;
    private javax.swing.JMenu helpMenu;
    private javax.swing.JMenuItem loadItem;
    private javax.swing.JScrollPane logScPn;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JButton resetBtn;
    private javax.swing.JButton runBtn;
    private javax.swing.JLabel scoreLbl;
    private javax.swing.JTextField scoreTF;
    private javax.swing.JButton stepBtn;
    private javax.swing.JTabbedPane tabPn;
    private javax.swing.JComboBox worldCBox;
    private javax.swing.JLabel worldLbl;
    private javax.swing.JPanel worldPnl;
    // End of variables declaration//GEN-END:variables
}
